import Vue from 'vue'

// 清除默认样式的css
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 加载效果
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)


import '@/styles/index.scss' // global css

// 根组件
import App from './App'
// 仓库
import store from './store'
// 路由
import router from './router'
// 图标样式
import '@/icons' // icon
import '@/permission' // permission control

// 全局组件-三级联动
import CategorySelect from '@/components/CategorySelect'
Vue.component(CategorySelect.name,CategorySelect)

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}



// 引入API接口
import API from '@/api/'
// 将API挂载到Vue原型对象上，Vue实例对象(vm)和组件实例对象VueComponent(vc)都能使用
Vue.prototype.$API=API

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
